<template>
	<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
  <div id="main" style="width: 600px;height:400px;"></div>
</template>

<script>
import * as echarts from 'echarts/core';
import {
    GridComponent
} from 'echarts/components';
import {
    LineChart
} from 'echarts/charts';
import {
    CanvasRenderer
} from 'echarts/renderers';

echarts.use(
    [GridComponent, LineChart, CanvasRenderer]
);

export default {
	name: 'chart',

	data() {
		return {

		}
	},

	mounted() {
		var chartDom = document.getElementById('main');
		var myChart = echarts.init(chartDom);
		var option;

		option = {
	    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
	    },
	    yAxis: {
	       type: 'value'
	    },
	    series: [{
        data: [150, 230, 224, 218, 135, 147, 260],
        type: 'line',
      	//smooth: true,
        areaStyle: {},
	    }]
		};

		option && myChart.setOption(option);
	}

}

</script>